package com.henry.web;

import com.henry.dao.entity.SysTplPconfig;
import com.henry.service.SysTplPconfigService;
import com.henry.web.vo.Response;
import com.henry.web.vo.SysTplPconfigRequestBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;



/**
 * <p>
 * 代码生成器，配置信息 前端控制器111
 * </p>
 *
 * @author zhenggui.wu
 * @since 2017-06-01 16:11:09
 */
@RestController
@RequestMapping("sysTplPconfig")
public class SysTplPconfigController {

    @Autowired
    private SysTplPconfigService sysTplPconfigService;

    /**
     * 跳转list列表页面
     */
    @RequestMapping(value = "/sysTplPconfigList.show", method = RequestMethod.GET)
    public ModelAndView sysTplPconfigList(SysTplPconfigRequestBean sysTplPconfigRequestBean) {
        List<SysTplPconfig> sysTplPconfigList =sysTplPconfigService.findAllSysTplPconfig(sysTplPconfigRequestBean);
        ModelAndView view=new ModelAndView("systplpconfig/systplpconfigList");
        view.addObject("sysTplPconfigList",sysTplPconfigList);
        return view;
    }

    /**
     * 跳转新增页面
     */
    @RequestMapping(value = "/add.show", method = RequestMethod.GET)
    public ModelAndView addPage() {
        return new ModelAndView("systplpconfig/systplpconfig_add");
    }


    /**
     * 保存
     */
    @RequestMapping(value = "/save.do", method = RequestMethod.POST)
    public Response save(SysTplPconfigRequestBean sysTplPconfigRequestBean){
        return sysTplPconfigService.saveSysTplPconfig(sysTplPconfigRequestBean);
    }

    /**
     * 修改
     */
    @RequestMapping(value = "/update.do", method = RequestMethod.POST)
    public Response update(SysTplPconfigRequestBean sysTplPconfigRequestBean){
        return sysTplPconfigService.updateSysTplPconfig(sysTplPconfigRequestBean);
    }

    @RequestMapping(value = "/delete.do/{id}", method = RequestMethod.POST)
    public Response delete(@PathVariable("id") Integer id){
        return sysTplPconfigService.deleteSysTplPconfig(id);
    }

}